import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

// 全局注册房产框
import PropertyBox from '@/components/PropertyBox.vue'
Vue.component('PropertyBox', PropertyBox)

Vue.config.productionTip = false

Vue.directive('imgErr', {
  inserted (el, binding) {
    try {
      el.addEventListener('error', function () {
        el.src = binding.value
      })
      el.src = el.src || binding.value
    } catch (error) {

    }
  },
  componentUpdated (el, binding) {
    try {
      el.addEventListener('error', function () {
        el.src = binding.value
      })
      el.src = el.src || binding.value
    } catch (error) {

    }
  }
})

Vue.use(ElementUI)
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
}).$mount('#app')
